Make `SePolicy` have `Send`
authorColin Walters <walters@verbum.org>
Mon, 20 Sep 2021 21:53:16 +0000 (17:53 -0400)
committerColin Walters <walters@verbum.org>
Fri, 6 May 2022 16:53:57 +0000 (12:53 -0400)
It's safe to send between threads, and I want to do so
in ostree-rs-ext to send to a tokio worker thread.

rust-bindings/rust/conf/ostree.toml
rust-bindings/rust/src/auto/se_policy.rs

index 1d72f850b5b5027319241dc83191eeb5d3d6c29f..64abc10ae5448472fe5029c6978b07170b0128d7 100644 (file)
@@ -192,6 +192,7 @@ status = "generate"
 [[object]]
 name = "OSTree.SePolicy"
 status = "generate"
+concurrency = "send"
     [[object.function]]
     # [IGNORE] has an unused raw pointer parameter
     name = "fscreatecon_cleanup"
index 029e078569c87eae0c69e838a17fa33031bd9b81..d6e93cd46fa8622ad76cd02bc5fa85a1f1b94bb9 100644 (file)
@@ -106,6 +106,8 @@ impl SePolicy {
     }
 }
 
+unsafe impl Send for SePolicy {}
+
 impl fmt::Display for SePolicy {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         f.write_str("SePolicy")